<template>
  <view class="container">
    <!-- 顶部组件 -->
    <u-navbar
      :is-back="true"
      :background="{ background: 'transparent' }"
      :border-bottom="false"
      id="nav-bar"
      title="积分收支明细"
    >
    </u-navbar>

    <image class="bg" src="/static/images/bg.png" mode="widthFix"></image>
    <view class="main-header">
      <image
        class="header-bg"
        src="/static/images/jfszmx-bg.png"
        mode="widthFix"
      />
      <image
        class="header-btn"
        src="/static/images/jfszmx-btn.png"
        mode="widthFix"
      />
      <view class="header-data">
        <view class="dataShow">60390</view>
        <view class="dataLabel">我的积分</view>
      </view>
    </view>
    <!-- 订单列表 -->
    <!-- <mescroll-body
          ref="mescrollRef"
          @init="mescrollInit"
          top="0"
          @down="downCallback"
          :up="upOption"
          @up="upCallback"
        > -->

    <view class="list">
      <view class="item">
        <view class="header">
          <view class="left">
            <view class="title-box">
              <view class="title">自主申请</view>
              <view class="subTitle">8120938012940912348</view>
            </view>
          </view>
          <text class="status blue">审核通过</text>
        </view>
        <view class="row">
          <view class="label">状态</view>
          <view class="value green">已出账</view>
        </view>
        <view class="row">
          <view class="label">说明</view>
          <view class="value">平台奖励</view>
        </view>
      </view>
    </view>

    <!-- </mescroll-body> -->
  </view>
</template>
<script>
import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js';
import service from '@/common/service';
import util from '@/common/utils';

export default {
  mixins: [MescrollMixin],
  data() {
    return {
      upOption: {
        page: {
          num: 0,
          size: 10,
        },
        noMoreSize: 5,
        empty: {
          icon: 'https://api.hjsfpay.com/image/newimg/all-noData.png',
          tip: '',
        },
      },
      mescroll: null,
      tabList: [
        {
          name: '全部',
          count: 0,
        },
        {
          name: '报备中',
          count: 0,
        },
        {
          name: '报备成功',
          count: 0,
        },
        {
          name: '报备失败',
          count: 0,
        },
      ],
      tabCurrent: 0,
      currentData: {},
      keyword: '',
    };
  },
  onLoad(e) {
    if (e.tab) {
      this.tabCurrent = Number(e.tab);
    }
  },
  methods: {
    customBack() {
      uni.switchTab({
        url: '/pages/my/index',
      });
    },
    mescrollInit(mescroll) {
      this.mescroll = mescroll;
    },
    downCallback() {
      this.recordList = [];
      this.mescroll.resetUpScroll();
    },
    upCallback(page) {
      this.getTradePage(page);
    },
    getTradePage(page) {
      const that = this;
      const param = {
        pageNumber: page.num,
        pageSize: page.size,
        status: that.tabCurrent,
      };
      service.getTradePage(
        param,
        function (res) {
          if (res && res.data) {
            that.mescroll.endSuccess(res.data.data.length);
            if (page.num == 1) that.recordList = [];
            that.recordList = that.recordList.concat(res.data.data);
          }
        },
        function (res) {}
      );
    },
    change(index) {
      this.tabCurrent = index;
      this.recordList = [];
      this.mescroll.resetUpScroll();
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 0 0 60rpx;
  background-color: #f5f5f5;
  box-sizing: border-box;
  .bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
  }
}

.list {
  width: 100%;
  padding: 30rpx;
  .item {
    position: relative;
    width: 100%;
    height: auto;
    padding: 30rpx;
    background: #ffffff;
    border-radius: 16rpx;
    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 0 0 30rpx;
      border-bottom: 1rpx solid #eeeeee;
      .left {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        .icon {
          width: 32rpx;
          height: 32rpx;
        }
        .title-box {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          justify-content: flex-start;
          padding-left: 10rpx;
          line-height: 1;
          text-align: left;
          .title {
            font-weight: 800;
            font-size: 28rpx;
            color: #333333;
          }
          .subTitle {
            margin-top: 13rpx;
            font-weight: 400;
            font-size: 24rpx;
            color: #999999;
          }
        }
      }
      .status {
        margin-left: 10rpx;
        height: 28rpx;
        line-height: 28rpx;
        padding: 0;
        font-weight: 400;
        font-size: 20rpx;
        text-align: right;
      }
    }
  }
}

.main-header {
  position: relative;
  width: 100%;
  padding: 0 30rpx;
  background-color: #ffffff;
  .header-bg {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 1;
  }
  .header-btn {
    position: absolute;
    top: 50%;
    right: 50rpx;
    transform: translateY(-50%);
    width: 98rpx;
    height: 98rpx;
    z-index: 3;
  }
  .header-data {
    position: absolute;
    top: 50%;
    left: 50rpx;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    z-index: 9;
    .dataShow {
      font-family: DIN, sans-serif;
      font-weight: bold;
      font-size: 48rpx;
      color: #ffeacc;
      line-height: 1;
    }
    .dataLabel {
      margin-top: 20rpx;
      font-weight: 500;
      font-size: 24rpx;
      color: #ffffff;
    }
  }
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 15rpx 0;
  .label {
    width: 120rpx;
    font-weight: 400;
    font-size: 24rpx;
    color: #999999;
    text-align: left;
  }
  .value {
    flex: 1;
    min-width: 0;
    padding-left: 60rpx;
    font-weight: 400;
    font-size: 24rpx;
    color: #333333;
    text-align: right;
  }
}

.blue {
  color: #3388ff !important;
}

.red {
  color: #fa6161 !important;
}

.purple {
  color: #6d5acb !important;
}

.green {
  color: #22c071 !important;
}

.yellow {
  color: #ffbb33 !important;
}
</style>
